I have trayicon on Qdialog, also I have a webview on Qmainwindow. I want to do that a web page run like tray. The codes run perfectly but i have a problem with the window size. when I maximize the page on tray, the web page is smaller than qwidget.
//main.cpp
#include "window.h" //the object inherited by Qdialog
#include "mainwindow.h" //the object inherited by Qmainwindow
int main(int argc, char *argv[])
{
Window box;
MainWindow window;
window.setParent(&box);
return app.exec();
}
//window.cpp
Window::Window()
{
createActions();
createTrayIcon();
setIcon();
/*..*/
trayIcon->show();
setWindowTitle(tr("Blog Search"));
resize(600, 600);
}
MainWindow::MainWindow()
{
qsrand((uint)time.msec());
int randomValue = qrand() % 999;
view = new QWebView(this);
QUrl url
= QUrl::fromEncoded("http://blogsearch.google.com/blogsearch?hl=tr&ie=UTF-8&q=C%2B%2B&&output=rss");
url.addQueryItem("num", "1");
url.
addQueryItem("start" ,
QString::number(randomValue
));
view->load(url);
/* ...... */
setCentralWidget(view);
}
/*
all the functions here
*/
//main.cpp
#include "window.h" //the object inherited by Qdialog
#include "mainwindow.h" //the object inherited by Qmainwindow
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window box;
MainWindow window;
window.setParent(&box);
return app.exec();
}
//window.cpp
Window::Window()
{
createActions();
createTrayIcon();
setIcon();
/*..*/
trayIcon->show();
setWindowTitle(tr("Blog Search"));
resize(600, 600);
}
MainWindow::MainWindow()
{
QTime time = QTime::currentTime();
qsrand((uint)time.msec());
int randomValue = qrand() % 999;
view = new QWebView(this);
QUrl url = QUrl::fromEncoded("http://blogsearch.google.com/blogsearch?hl=tr&ie=UTF-8&q=C%2B%2B&&output=rss");
url.addQueryItem("num", "1");
url.addQueryItem("start" ,QString::number(randomValue));
view->load(url);
/* ...... */
setCentralWidget(view);
}
/*
all the functions here
*/
To copy to clipboard, switch view to plain text mode
some of the codes above.
Can you help me about what can I do for resize the mainwindow ?
Bookmarks