void CGraphicBuildingTile::display(QList<QString> _toDisplay) { QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent())); QVBoxLayout* newLayout = new QVBoxLayout(); int q=0; QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent())); for(int i=0;i<_toDisplay.count();i++) { QLabel* newLabel = new QLabel(_toDisplay.at(i)); newLabel->setFixedWidth(280); newLabel->setMinimumHeight(22); newLabel->setStyleSheet("border: 1px solid black"); newLayout->addWidget(newLabel); q++; } QPalette pal; pal.setColor(QPalette::Background,QColor(230,200,167)); infoDialog->setFixedWidth(330); infoDialog->setMinimumHeight(30+22*q); infoDialog->setLayout(newLayout); infoDialog->setAutoFillBackground(true); infoDialog->setPalette(pal); infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog); scrolArea->setWidget(infoDialog); scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog); scrolArea->setMaximumHeight(infoDialog->size().height()+2); scrolArea->setWindowTitle(QString("Info about")); scrolArea->show(); }
void MainWindow::on_actionQueue3_triggered() //Show Sky Map { /*QDialog * dial = new QDialog; dial->setBaseSize(1300,800); dial->setWindowTitle("Sky map"); //dial->setStyleSheet("background: url(:/new/prefix1/skymap_source.png)");*/ QLabel *image = new QLabel(); image->setPixmap( QPixmap( ":/new/prefix1/skymap_source.png" ) ); image->setBackgroundRole(QPalette::Base); image->setBaseSize(1200,800); image->setScaledContents(true); QScrollArea * scrollArea = new QScrollArea; //scrollArea->setBackgroundRole(QPalette::Dark); scrollArea->setBaseSize(1200,800); scrollArea->setWidget(image); scrollArea->setWindowTitle("Sky map"); scrollArea->show(); //setCentralWidget(scrollArea); /*QVBoxLayout * mainLayout = new QVBoxLayout(); dial->setLayout(mainLayout); dial->exec();*/ }
/** * Opens a window containing the image found under the given path. * @param imagePath The path to the image a window is opened for. */ void CameraCalibrationEvaluation::openMaxPicWindow(const QString &imagePath) { qDebug() << "CameraCalibrationEvaluation::openMaxPicWindow(const QString " "&imagePath) ..."; QScrollArea *sArea = new QScrollArea; QLabel *label = new QLabel; QPixmap *pixmap = new QPixmap(imagePath); label->setPixmap(*pixmap); sArea->setWidget(label); sArea->setWindowTitle(imagePath); sArea->showMaximized(); }
int main(int argc, char *argv[]) { application app(argc, argv); icon_editor* editor = new icon_editor; editor->set_icon_image(QImage(":/icon_editor_images/mouse.png")); QScrollArea area; area.setWidget(editor); area.setWidgetResizable(true); area.setFocusPolicy(Qt::NoFocus); area.viewport()->setBackgroundRole(QPalette::Dark); area.viewport()->setAutoFillBackground(true); area.setWindowTitle(QObject::tr("Icon Editor")); editor->setFocus(Qt::OtherFocusReason); // TODO: simpler way of focusing scroll area's widget? area.show(); return app.exec(); }
void PrettyImage::ShowFullsize() { // Work out how large to make the window, based on the size of the screen QRect desktop_rect(QApplication::desktop()->availableGeometry(this)); QSize window_size(qMin(desktop_rect.width() - 20, image_.width()), qMin(desktop_rect.height() - 20, image_.height())); // Create the window QScrollArea* window = new QScrollArea; window->setAttribute(Qt::WA_DeleteOnClose, true); window->setWindowTitle(tr("Clementine image viewer")); window->resize(window_size); // Create the label that displays the image QLabel* label = new QLabel(window); label->setPixmap(QPixmap::fromImage(image_)); // Show the label in the window window->setWidget(label); window->setFrameShape(QFrame::NoFrame); window->show(); }
//@@@ basic definitions int main(int argc, char *argv[]) { QApplication a(argc, argv); Arena *w = new Arena; //vector<string> vec; w->vec.push_back("1"); w->vec.push_back("2"); w->vec.push_back("3"); w->vec.push_back("4"); /* w->vec.push_back("5"); w->vec.push_back("6"); w->vec.push_back("7"); w->vec.push_back("8"); w->vec.push_back("9"); w->vec.push_back("10"); w->vec.push_back("11"); w->vec.push_back("12");w->vec.push_back("13");w->vec.push_back("14");w->vec.push_back("15"); w->vec.push_back("16");w->vec.push_back("17");w->vec.push_back("18");w->vec.push_back("19");w->vec.push_back("20"); w->vec.push_back("21");w->vec.push_back("22");w->vec.push_back("23");w->vec.push_back("24");w->vec.push_back("25"); w->vec.push_back("26");w->vec.push_back("27");w->vec.push_back("28");w->vec.push_back("29");w->vec.push_back("30"); w->vec.push_back("31");w->vec.push_back("32");w->vec.push_back("33");w->vec.push_back("34");w->vec.push_back("35"); w->vec.push_back("36");w->vec.push_back("37");w->vec.push_back("38");w->vec.push_back("39");w->vec.push_back("40"); w->vec.push_back("41"); // ################################################################// /**********************Creating indexes ******************************/ ifstream iput; int updateCounter=100; //to update index files // int n=10; // display list size string str1="qvlc"; int flag=0,flag1=0; FILE* fp; fp=fopen("counter.txt","r"); if(fp==NULL) { flag=1; } else fclose(fp); if(flag==1) { int k=1; fp=fopen("counter.txt","w"); fprintf(fp,"%i",k); fclose(fp); } else { iput.open("counter.txt"); int count; iput>>count; iput.close(); if(count>=updateCounter) { // callFileList(); flag1=1; count=-1; } count++; fp=fopen("counter.txt","w+"); fprintf(fp,"%i",count); fclose(fp); } if(flag1==1 || flag==1) { fileList f1; f1.runner(); } /********************Reading files in Prefix -trie********************************/ Btree b1; b1.takeInput(str1); tries t2; callPrefixTrie(t2); /*************************history trie*****************************************/ tries t1; callHistoryTrie(t1); /**************************************************************/ string str; cout<<"enter the string :"<<endl; //cin>>str; //vector<fax*> inputVector; //inputVector=process(str,t2,t1,n); /* for(int i=0;i<star.size();i++) { cout<<star[i]->nam<<endl; } */ /* fax* fax1=new fax("rhythmbox-client","##"); show(fax1,t2,t1); onClose(t1); */ //##########################################################################3 w->startArena(t1,t2, 15); QScrollArea scrollarea; scrollarea.setWidget(w); scrollarea.setWidgetResizable(true); scrollarea.viewport()->setBackgroundRole(QPalette::Dark); scrollarea.viewport()->setAutoFillBackground(true); scrollarea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); scrollarea.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); scrollarea.setWindowTitle(QObject::tr("arena")); scrollarea.show(); //w->show(); return a.exec(); }